<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!--
         charAt():返回指定位置的字符 
        语法:string.charAt(index:表示返回字符的索引)
        -->
    <!-- w3c实例 -->
    <script>
        var txt = "'这段话是测试charAt()'";
        console.log(" 请看  " + txt + "  的索引字符5是:" + txt.charAt(5));
    </script>
</body>

</html>